//
//  LVIssueAndReceiveCell.m
//  LEVE
//
//  Created by 上官惠阳 on 2017/3/2.
//  Copyright © 2017年 dashuju. All rights reserved.
//

#import "LVIssueAndReceiveCell.h"
#import "UIView+Layer.h"
#import <objc/runtime.h>

@interface LVIssueAndReceiveCell ()
@property (copy,nonatomic)void (^longPressBlock)(id obj);
@end

@implementation LVIssueAndReceiveCell
- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)layoutSubviews
{
    [super layoutSubviews];

    [_headIconBtn makeRoundedCorners];
}

- (void)setStateType:(LVImpStateType)stateType
{
    switch (stateType) {
        case LVImpStateSuccess:
            [_stateBtn setImage:[UIImage imageNamed:@"greet_success"] forState:UIControlStateNormal];
            break;
        case LVImpStateWaiting:
            [_stateBtn setImage:[UIImage imageNamed:@"greet_wait"] forState:UIControlStateNormal];
            break;
        case LVImpStatefailuer:
            [_stateBtn setImage:[UIImage imageNamed:@"greet_fail"] forState:UIControlStateNormal];
            break;
        case LVImpStateBanana:
            [_stateBtn setImage:[UIImage imageNamed:@"manage_next"] forState:UIControlStateNormal];
            break;
        default:
            [_stateBtn setImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
            break;
    }
}
- (void)addLongPressWithBlock:(void (^)(id obj))longPreBlock
{
    if (!self.gestureRecognizers) {
        UILongPressGestureRecognizer *longPre = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressAction:)];
        _longPressBlock = longPreBlock;
        [self addGestureRecognizer:longPre];
    }
}
- (void)longPressAction:(UILongPressGestureRecognizer *)longPre
{
    if (_longPressBlock) {
        //这里后面要传数据model回去比较好
        _longPressBlock(nil);
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
@end
